package com.xiaoshuidi.cloud.framework.systemevent.core;

import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.stream.function.StreamBridge;

import javax.annotation.Resource;

@Slf4j
public class LeaseSystemEventProducer {
    @Resource
    private StreamBridge streamBridge;

    public void send(LeaseSystemEventData data) {
        log.info("发送系统事件消息 {}", data.toString());
        streamBridge.send(LeaseSystemEventConstants.OUTPUT, new LeaseSystemEvent(data.getType(), data));
    }
}
